from django.conf.urls import url

from hero_books import views

urlpatterns = [
    url(r'^$', views.index),
    url(r'^books/(\d+)/$', views.detail, name="bookdetail"),
    url(r'^area/$', views.area),
    url(r'^(?P<bid>[0-9]+)/(?P<bread>[0-9]+)/$', views.show_params, {"food": 'rice'}),  # 正则表达式命名组，通过关键字参数传递给视图
    url(r'^articles/(?P<year>[0-9]{4})/$', views.url_reverse, name="new-yaer-article"),
    url(r'^years/(?P<year>[0-9]{4})/$', views.year, name="years")

]
